using System;
using System.Collections.Generic;
using System.Text;

using Db4o.Framework.Interfaces;

namespace SampleBusiness
{
    public class Pilot : ManagedType
    {
        private string name;
        private int points;
        private Car car;

        public Car Car
        {
            get { return car; }
            set { car = value; }
        }
	
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        
        public int Points
        {
            get { return points; }
            set { points = value; }
        }

        public Pilot(string name, int points,Car car) 
        {
            Name = name;
            Points = points;
            Car = car;
        }
        public Pilot(string name)
        {
            Name = name;
            Points = 0;
        }
        public Pilot()
        {
        }
        public void addPoints(int points)
        {
            Points += points;
        }

        public override string ToString()
        {
            return String.Format("[{3}] {0} : {1} pts - {2}", Name, Points,Car,Id);
        }
    }
}
